package controller

import (
	"net/http"

	"github.com/gin-gonic/gin"
	"github.com/go-delve/delve/service"
)

// IndexHandle ss
func IndexHandle(c *gin.Context) {
	// 根据Context的参数-从service读取数据
	articleRecordList, err := service.GetAllCategoryList()
	if err != nil {
		c.HTML(http.StatusInternalServerError, "views/500.html", nil)
		return
	}
	c.HTML(http.StatusInternalServerError, "views/index.html", gin.H{
		"article_list": articleRecordList
	})

}
